import "./assets/main.scss";
// import "./assets/reactive.scss";

import {
	createApp,
	defineAsyncComponent
} from "vue";
import {
	createPinia
} from "pinia";

import ElementPlus from "element-plus";
import "element-plus/dist/index.css";
import zhCn from 'element-plus/dist/locale/zh-cn.js';
// import zhCn from 'element-plus/lib/locale/lang/zh-cn';

// 如果您正在使用CDN引入，请删除下面一行。
import * as ElementPlusIconsVue from "@element-plus/icons-vue";

import App from "./App.vue";
import router from "./router";
import './router/permission.js'; // permission control

const app = createApp(App);

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
	app.component(key, component);
}

app.use(ElementPlus, {
	locale: zhCn,
});
app.use(createPinia());
app.use(router);
// app.use(router)

app
	// .component('App', App)
	.component(
		"lButton",
		defineAsyncComponent(() => import("./components/l-button/l-button.vue"))
	)
	.component(
		"lTab",
		defineAsyncComponent(() => import("./components/l-tab/l-tab.vue"))
	)
	.component(
		"lCard",
		defineAsyncComponent(() => import("./components/l-card/l-card.vue"))
	)

app.mount("#app");